setMatte

abstract fun setMatte(block: DesignBlock, source: DesignBlock?, mode: MatteMode = MatteMode.ALPHA)

Mask a block with the rendered alpha or luminance of another block, like a track matte. A block used as a matte source is not drawn on its own. If the source draws nothing, for example because it is hidden or outside its time range, an alpha or luma matte hides the block and an inverted matte shows it whole. SVG export does not apply mattes, so a matted block exports whole. Required scope: "layer/clipping" on the block, and "layer/visibility" on the source, which stops drawing on its own. Experimental: this API may change in a minor release.

Parameters

block

the block to mask. Graphic, text and group blocks are supported.

source

the block whose rendering masks the block, or null to remove the matte. It must be on the same page as the block, or both must be on no page. It may not be the block itself, one of its parents, or a block that the block or one of its parents masks, or a block that contains such a block.

mode

the channel of the source that masks the block.